<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .color{
            width: 400px;
            height: 50px;
            background-image: linear-gradient(
                to right,
                red 20%,
                orange 20% 40%,
                yellow 40% 60%,
                green 60% 80%,
                blue 80% 100%
                );
        }
    </style>
</head>
<body>
    <div class="color"></div>
</body>
</html>